<template>
  <div class="home">
    <el-container>
      <el-aside width="200px" class="wrap_box">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          router
        >
          <el-menu-item :index="item.path" v-for="(item,index) in tabArr" :key="index">
            <i :class="item.meta.icon"></i>
            <span slot="title">{{item.meta.title}}</span>
          </el-menu-item>

        </el-menu>
      </el-aside>
      <el-container>
        <el-main><router-view></router-view></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";

export default {
  name: "Home",
  data(){
   return{
     tabArr:[]
   }
  },
  created() {
    this.tabArr=this.$router.getRoutes().filter(item=>item.meta.title);
    console.log(this.tabArr);
  },
  components: {

  },
};
</script>
<style>
.home {
  width: 100%;
  height: 100%;
}
.wrap_box {
  height: 100vh;
}
.el-menu-vertical-demo{
  height: 100vh;
}
.el-header,
.el-footer {
border-bottom: 1px solid;
line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>